package main

import "fmt"

// type 关键字  可以给一种数据类型起别名
type myint int

// type 还可以用来定义一个结构体
type book struct {
	auth   string
	tittle string
}

func changetBook1(book1 book) {
	book1.auth = "li4"
}

func changeBook2(book2 *book) {
	book2.auth = "li4"
}

func main() {
	var myint1 myint = 1
	fmt.Println(myint1)

	book1 := book{}
	book1.auth = "zhang3"
	book1.tittle = "aaa"
	fmt.Printf("%v\n", book1)

	// 函数传参 如果直接传就是传值
	changetBook1(book1)
	fmt.Println("book1: ", book1)
	changeBook2(&book1)
	fmt.Println("book1: ", book1)

}
